package com.reder.practice.common.enums.state;

import com.reder.practice.common.enums.Statable;
import lombok.Getter;

/**
 * 通用响应枚举类
 *
 * @author Imp
 * email: 1318944013@qq.com
 * date: 2019/3/6 10:25
 */
@Getter
public enum CommonState implements Statable {

    SUCCESS(Statable.SUCCESS_CODE, "成功"),
    ERROR(-1, "操作失败"),
    PARAMETER_UNCOMPLETED(-2, "参数不完整"),
    QUERY_ERROR(-3, "查询不到"),
    YOU_NEED_LOGIN_FIRST(-4, "您还没有登录"),
    SERVER_INTERNAL_ERROR(-5, "服务器开小差啦~~ 稍后再试试");

    int code = Statable.SUCCESS_CODE;
    String msg = null;

    CommonState(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
